/*
 * EntryTriple.java
 *
 * Created on June 27, 2006, 2:43 PM
 *
 */

package galronnlp.pcfg.parser;

import galronnlp.util.*;

/**
 * An implementation of a 3-tuple
 *
 * @author Daniel A. Galron
 */
public class EntryTriple extends Tuple implements Comparable {
    
    /**
     * Creates a new instance of EntryTriple
     */
    public EntryTriple() {
        super(3);
    }
    
    public EntryTriple(Object o1, Object o2, Object o3) {
        this();
        this.array[0] = o1;
        this.array[1] = o2;
        this.array[2] = o3;
    }

    public int compareTo(Object o) {
        EntryTriple other = (EntryTriple)o;
        return ((Double)this.array[0]).compareTo((Double)other.array[0]);
    }
    
    public String toString() {
        return "(" + this.array[0] + ", " + this.array[1] + ", " + this.array[2] + ")";
    }
    
}
